From 5a07ccea50eb99e89226ed5f5a5896d2d28e1063 Mon Sep 17 00:00:00 2001
From: Petr Vorel <pvorel@suse.cz>
Date: Mon, 29 Jul 2019 13:12:24 +0200
Subject: [PATCH] net/multicast: Remove mc_gethost

mc_gethost was used in multicast tests, which were migrated to use
tst_net.sh in the past. Last mc_member use was removed in bed22a78c.

Fixes: ("bed22a78c network: mc_member: use tst_ipaddr(), cleanup")

Signed-off-by: Petr Vorel <pvorel@suse.cz>
[Retrieved from:
https://github.com/linux-test-project/ltp/commit/5a07ccea50eb99e89226ed5f5a5896d2d28e1063]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 testcases/network/.gitignore                  |   1 -
 testcases/network/multicast/Makefile          |   4 -
 .../network/multicast/mc_gethost/Makefile     |  22 ----
 .../network/multicast/mc_gethost/mc_gethost.c | 105 ------------------
 4 files changed, 132 deletions(-)
 delete mode 100644 testcases/network/multicast/mc_gethost/Makefile
 delete mode 100644 testcases/network/multicast/mc_gethost/mc_gethost.c

diff --git a/testcases/network/.gitignore b/testcases/network/.gitignore
index e952f6f9f2..dab2bc34e7 100644
--- a/testcases/network/.gitignore
+++ b/testcases/network/.gitignore
@@ -7,7 +7,6 @@
 /lib6/getaddrinfo_01
 /lib6/in6_01
 /lib6/in6_02
-/multicast/mc_gethost/mc_gethost
 /multicast/mc_commo/mc_recv
 /multicast/mc_commo/mc_send
 /multicast/mc_member/mc_member_test
diff --git a/testcases/network/multicast/Makefile b/testcases/network/multicast/Makefile
index 6ade5e5b7c..590f41e39b 100644
--- a/testcases/network/multicast/Makefile
+++ b/testcases/network/multicast/Makefile
@@ -24,8 +24,4 @@ top_srcdir		?= ../../..
 
 include $(top_srcdir)/include/mk/env_pre.mk
 
-ifeq ($(ANDROID),1)
-FILTER_OUT_DIRS		+= mc_gethost
-endif
-
 include $(top_srcdir)/include/mk/generic_trunk_target.mk
diff --git a/testcases/network/multicast/mc_gethost/Makefile b/testcases/network/multicast/mc_gethost/Makefile
deleted file mode 100644
index d5eaf8480f..0000000000
--- a/testcases/network/multicast/mc_gethost/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-#    Copyright (C) 2013, Linux Test Project
-#
-#    This program is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation; either version 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License along
-#    with this program; if not, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-
-top_srcdir		?= ../../../..
-
-include $(top_srcdir)/include/mk/testcases.mk
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/network/multicast/mc_gethost/mc_gethost.c b/testcases/network/multicast/mc_gethost/mc_gethost.c
deleted file mode 100644
index 9cc15d086b..0000000000
--- a/testcases/network/multicast/mc_gethost/mc_gethost.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/* host - print information about a host
- * originally written by Paul Vixie @DEC WRL, January 1989
- */
-
-/* DECWRL Header: host.c,v 1.1 89/04/05 15:41:12 vixie Locked $ */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <stdio.h>
-#include <resolv.h>
-#include <netdb.h>
-#include <syslog.h>
-#include <string.h>
-#include <stdlib.h>
-
-#ifndef LOG_PERROR
-#define LOG_PERROR 0
-#endif
-
-int main(int argc, char **argv)
-{
-	unsigned char b_addr[IN6ADDRSZ];
-	struct hostent *host;
-	char **ap, **cp, *arg;
-	const char *prog = "amnesia";
-	int af = AF_INET;
-	int size = INADDRSZ;
-	int force = 0;
-
-	if (argc < 1) {
-usage:
-		printf("usage:  %s [-d] [-6] [-f] (hostname|ipaddr)\n", prog);
-		exit(1);
-	}
-	prog = *argv++;
-	argc--;
-#ifdef LOG_USER
-	openlog(prog, LOG_PERROR, LOG_USER);
-#else
-	openlog(prog, LOG_PERROR);
-#endif
-	res_init();
-
-	if (argc >= 1 && !strcmp(*argv, "-d")) {
-		_res.options |= RES_DEBUG;
-		argv++, argc--;
-	}
-	if (argc >= 1 && !strcmp(*argv, "-6")) {
-		af = AF_INET6, size = IN6ADDRSZ;
-		_res.options |= RES_USE_INET6;
-		argv++, argc--;
-	}
-	if (argc >= 1 && !strcmp(*argv, "-f")) {
-		force++;
-		argv++, argc--;
-	}
-
-	if (argc < 1)
-		goto usage;
-	arg = *argv++;
-	argc--;
-
-	if (inet_pton(af, arg, b_addr)) {
-		char p[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"];
-
-		printf("[%s]\n", inet_ntop(af, b_addr, p, sizeof p));
-		if (!(host = gethostbyaddr((char *)b_addr, size, af))) {
-			herror("gethostbyaddr");
-			exit(1);
-		}
-	} else {
-		printf("{%s}\n", arg);
-		if (force)
-			host = gethostbyname2(arg, af);
-		else
-			host = gethostbyname(arg);
-		if (!host) {
-			herror("gethostbyname*");
-			exit(1);
-		}
-	}
-	printf("name: %s\n", host->h_name);
-	if (host->h_aliases && *host->h_aliases) {
-		printf("aliases:");
-		for (cp = (char **)host->h_aliases; *cp; cp++)
-			printf(" %s", *cp);
-		printf("\n");
-	}
-	if (host->h_addr_list && *host->h_addr_list) {
-		printf("addresses:");
-		for (ap = host->h_addr_list; *ap; ap++) {
-			char p[sizeof
-			       "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"];
-
-			printf(" %s", inet_ntop(host->h_addrtype,
-						*ap, p, sizeof p));
-		}
-		printf("\n");
-	}
-	exit(0);
-}
